﻿using System;
using System.Configuration.Abstractions;

namespace Sustainalytics.Entities
{
    public class BackOfficeAppSettings
    {
        public BackOfficeAppSettings(IAppSettings appSettings)
        {
            ThriftPort = int.Parse(appSettings["HBaseThriftPort"]);
            ThriftServer = appSettings["HBaseThriftServer"];
            WaitRetryDuration = TimeSpan.FromSeconds(int.Parse((appSettings["HBaseWaitRetryDuration"])));
            RetryNumberOfTimes = int.Parse(appSettings["HBaseRetryNumberOfTimes"]);
            PhoenixServer = appSettings["PhoenixServerUrl"];
            HiveConnectionString = appSettings["HiveConnectionString"];
            HbaseTablePrefix = appSettings["HBaseTablePrefix"];
        }

        public string ThriftServer { get; set; }
        public TimeSpan WaitRetryDuration { get; set; }
        public int RetryNumberOfTimes { get; set; }
        public string PhoenixServer { get; set; }
        public string HiveConnectionString { get; set; }
        public int ThriftPort { get; set; }
        public string HbaseTablePrefix { get; set; }
    }
}